function modelGMM = doModelforGMM(model)

% Output for controls:
% log(hours), wage, dc, infl, r, r4,r12,r20,r28,r40
modelGMM   = model;
pos_l      = find(strcmp(model.labely,'$l_t$'));
pos_w      = find(strcmp(model.labely,'$w_t$'));
pos_c      = find(strcmp(model.labely,'$c_t$'));
pos_pai    = find(strcmp(model.labely,'$\pi_t$'));
tmpPos     = [pos_l,pos_w, pos_c, pos_pai];
maturities = model.maturities;
idx_yields = (length(tmpPos)+1):length(tmpPos)+length(maturities(1:end));
nyGMM      = idx_yields(end);
nx         = model.nx;
% Allocating memory
modelGMM.gSS  = zeros(nyGMM,1);
modelGMM.g0   = zeros(nyGMM,1);
modelGMM.gx   = zeros(nyGMM,nx);
modelGMM.gxx  = zeros(nyGMM,nx,nx);
modelGMM.ny   = nyGMM;
% Scaling of inflation
scaling       = [1 1 1 4]'; 
ii            = 1:length(tmpPos);
modelGMM.gSS(ii,1)      = scaling.*model.gSS(tmpPos,1);
modelGMM.g0(ii,1)       = scaling.*model.g0(tmpPos,1);
modelGMM.gx(ii,:)       = scaling.*model.gx(tmpPos,:);
modelGMM.gxx(ii,:,:)    = scaling.*model.gxx(tmpPos,:,:);

% Level of yield curve
modelGMM.gSS(idx_yields,1)      = 4*model.bySS(maturities(1:end),1);
modelGMM.g0(idx_yields,1)       = 4*model.by0(maturities(1:end),1);
modelGMM.gx(idx_yields,:)       = 4*model.byx(maturities(1:end),:);
modelGMM.gxx(idx_yields,:,:)    = 4*reshape(model.byxx(maturities(1:end),:,:),length(maturities(1:end)),nx,nx);
labelYields = cell(1,length(maturities));
for i=1:length(maturities)
    labelYields{i} = ['$y',num2str(maturities(1,i)),'_t$'];
end
modelGMM.labely                 = [model.labely(tmpPos) labelYields];

end